package com.android.volley.cookies;

/**
 * The cookie bean.
 * @author ChameleonChen
 */
public class Cookie {

    private Long id;
    /** Not-null value. */
    private String key;
    private String value;
    private String domain;
    private String path;
    private java.util.Date expires;

    public Cookie() {
    }

    public Cookie(Long id) {
        this.id = id;
    }

    public Cookie(Long id, String key, String value, String domain,
                  String path, java.util.Date expires) {
        this.id = id;
        this.key = key;
        this.value = value;
        this.domain = domain;
        this.path = path;
        this.expires = expires;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /** Not-null value. */
    public String getKey() {
        return key;
    }

    /**
     * Not-null value; ensure this value is available before it is saved to the
     * database.
     */
    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public java.util.Date getExpires() {
        return expires;
    }

    public void setExpires(java.util.Date expires) {
        this.expires = expires;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Cookie other = (Cookie) obj;
        if (key == null || other.key == null) {
            return false;
        } else if (!key.equals(other.key))
            return false;
        return true;
    }

}
